<?php
/**
 * Класс Controller_Index отвечает за главную страницу
 * @author Mike
 */
class Controller_Index extends Controller_Base {
	
	public function action() {
		$this->getIndexPage();
	}

	/**
	 * Главная страница
	 */
	private function getIndexPage() {
// 		$objProduct = new Product();
// 		$arrPopularProducts = $objProduct->find('all', array(
// 				'select' => '`product`.`url`, `product`.`product_name`, `product`.`client_price`, `product`.`reviews_score`, `product`.`ID_photo`',
// 				'joins' => 'INNER JOIN `product_selection` USING(`ID_product`) INNER JOIN `selection` USING(`ID_selection`)',
// 				'conditions' => '`selection`.`is_main` = 1',
// 				'order' => '`ID_category` DESC',
// 				'limit' => 12
// 		));
		$arrPopularProducts = array();
		$objArticle = new Article(1);
		
		$this->description = $objArticle->getField('description');
		$this->title = $objArticle->getField('title');
		$this->keywords = $objArticle->getField('keywords');
		$this->bodyAttr = 'index';
	
		$this->showHeader();
			View_Index::showIndexPage($arrPopularProducts);
		$this->showFooter();
	}
}